[OTel-Sdk] Cherrypick main changes to remove 1ds-core-js and upgrade components#2714
[OTel-Sdk] Cherrypick main changes to remove 1ds-core-js and upgrade components#2714
Conversation
* [Main] Merge 1ds-core-js into applicationinsights-core-js Phase 1: Move files to keep history * Phase 2: Update imports, fix compile issues and delete unused * Phase 3: Move a few more files around * Phase 4: adjust imports from Phase 3 * Phase 5: Update 1ds-core-js README.md
There was a problem hiding this comment.
Pull request overview
This PR cherry-picks changes from main to remove the dependency on @microsoft/1ds-core-js by merging its functionality directly into the otel-core package. It also upgrades various build tooling and dependency versions across the monorepo.
Changes:
- Merges 1DS (OneCollector) core functionality (enums, interfaces, utilities,
AppInsightsExtCore,ValueSanitizer, span utilities) intoshared/otel-coreand re-exports them, removing the need for a separate1ds-core-jspackage. - Upgrades build tooling versions (Rush 5.169.3, npm 9.9.4,
@nevware21packages ^0.5.2,@nevware21/ts-utils>= 0.13.0) and replacesgit clean -xdf/rimrafclean scripts with a cross-platform Node.js-based clean approach, adding a separatefull-cleancommand. - Updates the Gruntfile to scope rollup TypeScript plugin includes to specific directories, enable source maps for test builds, and fix closure scoping for
modulePath.
Reviewed changes
Copilot reviewed 68 out of 70 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
shared/otel-core/src/enums/ext/Enums.ts |
New file: 1DS enums (ValueKind, EventLatency, TransportType, etc.) |
shared/otel-core/src/interfaces/ext/DataModels.ts |
New file: 1DS data model interfaces (IExtendedTelemetryItem, IExtendedConfiguration, etc.) |
shared/otel-core/src/ext/extUtils.ts |
New file: 1DS utility functions (sanitizeProperty, extend, openXhr, etc.) |
shared/otel-core/src/ext/extSpanUtils.ts |
New file: Span-to-telemetry-item conversion utilities |
shared/otel-core/src/ext/ValueSanitizer.ts |
New file: Field value sanitization logic |
shared/otel-core/src/ext/AppInsightsExtCore.ts |
New file: Extended core class for 1DS integration |
shared/otel-core/src/index.ts |
Adds 1DS exports; moves TransportType export |
shared/otel-core/src/enums/ai/SendRequestReason.ts |
Removes TransportType (moved to ext/Enums.ts) |
shared/otel-core/src/enums/ai/Enums.ts |
Exports EventPersistenceValue; doc fix |
shared/otel-core/src/constants/InternalConstants.ts |
Adds 1DS-related constants |
shared/otel-core/src/core/SenderPostManager.ts |
Updates TransportType import path |
shared/otel-core/src/utils/HelperFuncs.ts |
Updates TransportType import path |
shared/otel-core/src/interfaces/ai/ISenderPostManager.ts |
Updates TransportType import path |
shared/otel-core/src/telemetry/TelemetryItemCreator.ts |
Whitespace fix |
shared/otel-core/Tests/Unit/src/ext/*.ts |
New test files for 1DS merged functionality |
shared/otel-core/Tests/Unit/src/index.tests.ts |
Registers new 1DS test suites |
shared/otel-core/Tests/Unit/src/ai/ApplicationInsightsCore.Tests.ts |
Updates TransportType import |
shared/otel-core/Tests/Perf/src/AppInsights/Core/CorePerfCheck.Tests.ts |
Fixes imports and type annotations |
shared/otel-core/Tests/tsconfig.json |
Adds diagnostics flags |
shared/otel-core/package.json |
Version bumps, clean script update |
gruntfile.js |
Scoped includes, source maps, closure fix |
rush.json |
Rush/npm version bumps |
package.json |
Dev dep upgrades, adds ajv, new clean scripts |
.aiAutoMinify.json |
Adds new 1DS enums to minification config |
common/config/rush/command-line.json |
Adds full-clean bulk command |
common/scripts/install-run*.js |
Auto-generated Rush files updated |
AISKU/** |
Clean script updates, type refinements, unused import removal |
AISKULight/package.json |
Clean script and version updates |
channels/*/package.json |
Clean script and version updates |
extensions/*/package.json |
Clean script and version updates |
tools/*/package.json |
Clean script and version updates |
examples/*/package.json |
Version updates |
common/Tests/Framework/package.json |
Clean script and version updates |
AISKU/src/ApplicationInsightsContainer.ts |
Return type narrowed from IApplicationInsights to AppInsightsSku |
Files not reviewed (1)
- common/config/rush/npm-shrinkwrap.json: Language not supported
- Address dependency issues
| @@ -1,4 +1,4 @@ | |||
| import { AppInsightsSku as ApplicationInsights } from "../../../src/AISku"; | |||
| import { AppInsightsSku, AppInsightsSku as ApplicationInsights } from "../../../src/AISku"; | |||
There was a problem hiding this comment.
AppInsightsSku is imported as a named import alongside the alias AppInsightsSku as ApplicationInsights, but only the ApplicationInsights alias is used in this file. The bare AppInsightsSku import is unused and can be removed to keep the import clean: import { AppInsightsSku as ApplicationInsights } from "../../../src/AISku";
| import { AppInsightsSku, AppInsightsSku as ApplicationInsights } from "../../../src/AISku"; | |
| import { AppInsightsSku as ApplicationInsights } from "../../../src/AISku"; |
| @@ -1,4 +1,4 @@ | |||
| import { AppInsightsSku as ApplicationInsights } from "../../../src/AISku"; | |||
| import { AppInsightsSku, AppInsightsSku as ApplicationInsights } from "../../../src/AISku"; | |||
There was a problem hiding this comment.
AppInsightsSku is imported as a named import alongside the alias AppInsightsSku as ApplicationInsights, but only the ApplicationInsights alias is used in this file. The bare AppInsightsSku import is unused and can be removed.
| import { AppInsightsSku, AppInsightsSku as ApplicationInsights } from "../../../src/AISku"; | |
| import { AppInsightsSku as ApplicationInsights } from "../../../src/AISku"; |
No description provided.